package gostd

import "sync"

// Mutex stdin.
var inMutex = new(sync.Mutex)

// Mutex control stdin.
func In() Toggle {
	return Toggle{
		Lock: func() {
			inMutex.Lock()
		},
		TryLock: func() {
			inMutex.TryLock()
		},
		Unlock: func() {
			inMutex.Unlock()
		},
	}
}
